1. Field of Invention
This invention generally relates to the field of IP address allocation on a network. More particularly, this invention relates to a router and a method for avoiding IP addresses conflicts.
2. Related Prior Art
In a local area network (LAN), each of the machines, such as a computer, a printer, a scanner, a router and so on, is assigned with a unique IP address by a router used on that Local Area Network. In general, there may be more than one router in one Local Area Network, if necessary.
FIG. 3 is a block diagram showing a network system using a conventional router 9. The router 9 includes two network interfaces. One is the wide area network (WAN) port 90 and the other is the local area network (LAN) port 91. Typically, the WAN port 90 includes a WAN IP address 901 and a Dynamic Host Configuration Protocol (DHCP) client 902. The LAN port 91 includes a LAN IP address 911, an IP pool 912, and a Dynamic Host Configuration Protocol (DHCP) server 913.
The WAN port 90 is configured to be connected to a top-level router 9a which is similar in configuration to the router 9. As such, the DHCP client 902 of the router 9 can interact with the top-level router 9a to obtain a lease of an IP address, such as “192.168.1.1”, for the WAN IP address 901 in accordance with the Dynamic Host Configuration Protocol, a network application protocol used by devices (DHCP clients) to obtain configuration information for operation in an Internet Protocol network.
The IP pool 912 of the LAN port 91 is provided to be set up by an user and defines a list of non-overlapping IP address ranged in form of: from1-to 1, from 2-to2, . . . , from N-to N. For example, 192.168.2.0 to 192.168.2.9. This notation places periods between each of the four numbers (octets) that comprise an IP address. In this example, the first three numbers “192.168.2” are called the “network bits”, as they represent the ‘network’ portion of each machine's address. The remaining number “0.0,” “0.1”, . . . , or “0.9” is known as the “host bits”, as it represents the particular host machine on the network (i.e. in the range of addresses). Note that the IP addresses in the same IP pool have the network bits in common, whereas each of the IP addresses has unique the host bits.
The LAN IP address 911 of the router 9 has its own IP address selected from the IP pool 912. Typically, the router 9 uses the first IP address in the range as its LAN IP address 911 (i.e. 192.168.2.0 in this example). On the other hand, the DHCP server 913 are configured to allocate IP addresses to client terminals associated to the LAN port, such as a low-level router 9b, a laptop 9c and a personal computer 9d, in accordance with the Dynamic Host Configuration Protocol. Typically, when client terminals 9b, 9c, 9d are initialized, they request IP addresses from the DHCP server 913. The DHCP server 913 then allocates available IP addresses, such as 192.168.2.1 to 192.168.2.3, from the IP pool 912 to the client terminals 9b, 9c, 9d. The IP addresses are typically returned to the IP pool 912 after a lease time expires.
Normally, the network bits in the IP pool of the top-level router 9a (i.e. 192.168.1 in this example) differs from that of the mid-level router 9 (i.e. 192.168. 2). It is therefore that every IP address allocated from the top-level router 9a to the mid-level router 9 is addressed as “192. 168. 1. X” and is not going to be overlapped with those IP addresses “192. 168. 2. X” allocated from the mid-level router 9 to the low-level router 9b. However, if for any reason the top-level router 9a is shut down and then reboots again, the case may be totally different. That is, it may happen to have the IP addresses given out from the top-level router 9a identical to those given out from the mid-level router 9. More specifically, when the top-level router 9a is suddenly shut down and disconnected with the mid-level router 9, the IP allocation of the mid-level router 9 is not affected and still able to allocate an unused IP addresses of the IP pool 912, such as 192.168.2.4 to 192.168.2.9, in response to a location request message from a client terminal connected thereto. However, once after reboot, the top-level router 9a is reconnected with the mid-level router 9 and automatically allocates a new IP address to router 9 in accordance with the Dynamic Host Configuration Protocol. That is, the router 9 will replace the original IP address with the new IP address for the WAN IP address 901.
The problem is that after reboot, the top-level router 9a may inappropriately use the new network bits identical to that of the current IP pool of the router 9. For example, 192.168.2. This is so-called domain conflict, which occurs when two computers on a local network (or the Internet) have been assigned the same network bits. In this example, when the domain conflict occurs, the top-level router 9a may assign a new IP address, such as 192.168.2.1, from the range of 192.168.2.1 to 192.168.2.9, for the WAN IP address 902 of the router 9. The new IP address is therefore improperly overlapped with the one previously assigned to the low-level router 9b (i.e. 192.168.2.1 as well). In this event, the IP address conflict occurs since two machines, namely the mid-level router 9 and the low-level router 9b, on a local network have been assigned the same IP address. Note that the IP address conflict may further cause other unexpected problems later on.
One such system is described in Taiwan Patent No. 1227614, which discloses a method for dynamic host allocation. In the mechanism, a selected IP address to be assigned to a client terminal or machine will be checked before sent out in case the selected IP address is overlapped with the used IP addresses. Though it may be possible to ensure that the IP addresses allocated from a single router are not overlapped; however, the mechanism is incapable of ensuring whether the IP addresses allocated from more than one router still are not overlapped.